package com.design;

/**
 * 已发货
 */
public class ShipOrder implements OrderState{
    @Override
    public void pay(Order order) {
        System.out.println("已发货状态的订单无法支付");
    }

    @Override
    public void cancel(Order order) {
        System.out.println("已发货状态的订单无法取消");
    }

    @Override
    public void ship(Order order) {
        System.out.println("已发货的订单无法再次发货");
    }

    @Override
    public void receive(Order order) {
        System.out.println("订单已收货");
        order.setOrderState(new FinishOrder());
    }

    @Override
    public String getStateName() {
        return "已发货";
    }
}
